//
//  PushPerHome.m
//  CYWFrame
//
//  Created by Macx on 2017/12/13.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "PushPerHome.h"
#import "UIView+LZCView.h"

@implementation PushPerHome

+ (void)pushPerHomeWithUserInfo:(NSDictionary *)userInfo {
    
//    int state = [LZCTools thinkEnv];
//    
//    if (state == 0) {
//        
//    }
    
//    [LZCTools HUDMessage:@"即将开放" delay:1.5f];
    
    
    UIView *v = [[UIView alloc] init];
    
    UIViewController *currVC = [v topViewControllerWithRootViewController:[UIApplication sharedApplication].keyWindow.rootViewController];

    if (GetUserDefaule(USERINFO) == NULL) {
        [currVC presentViewController:[LZCTools alertMessage:@"请先登录"]animated:YES completion:nil];
        return;
    }
    
    NSString *uid = [NSString stringWithFormat:@"%@", [userInfo valueForKey:@"user_id"]];
    if ([[GetUserDefaule(USERINFO) valueForKey:@"user_id"] isEqualToString:uid]) {
        currVC.tabBarController.selectedIndex = 1;
    }
    else {
		/*
        PerHomeViewController *homeVC = [[PerHomeViewController alloc] init];
        homeVC.userInfo = userInfo;
        [currVC.navigationController pushViewController:homeVC animated:YES];
		 */
    }
    
    
}

@end
